import Vue from 'vue';

var axios = require('axios')

export const mtransmit = new Vue();

async function loadData(current, size, param, url) {
    var result = {};
    await axios
        .get(url, {
            params: {
                current: parseInt(current),
                size: parseInt(size),
                name: param.name,
                level: param.level,
                order: param.order,
                source: param.source
            }
        })
        .then(success => {
            result.success = true
            result.data = success
        })
        .catch(fail => {
            result.success = false
            result.data = fail
        })
    return result
}

function aaa(e) {
    return e
}

export {
    loadData,
    aaa
}